home *** CD-ROM | disk | FTP | other *** search
/ BBS in a Box 3 / BBS in a box - Trilogy III.iso / Files / Prog / D-G / FORTRAN Goodies / ChangeFilename.txt < prev    next >
Encoding:
Text File  |  1990-11-19  |  508 b   |  25 lines  |  [TEXT/MPS ]

  1. #
  2. # ChangeFileNames
  3. #
  4. #    - changes the filename extension
  5. #        of all files in the current directory
  6. #
  7. #    - takes 2 arguments, the old and new extensions
  8. #
  9. #    - commonly used to change ".FOR" to ".F"
  10. #    (i.e. changefilenames for f)
  11. #
  12. #    Example provided for owners of Language Systems FORTRAN
  13. #    © 1990 Language Systems Corp.
  14. #
  15. if {#} < 2
  16.     beep
  17.     echo "usage:  ChangeFileNames  OldExt  NewExt"
  18.     exit 1
  19. end
  20.  
  21. for name in `exists -f ≈"{1}"`
  22.     (evaluate "{name}" =~ /(≈)®1"{1}"/) > dev:null
  23.     rename "{name}" "{®1}{2}"
  24. end
  25.